{% extends "../topic/inc/topic_base.html" %}
{% block head %}
    <title>{{title}}-{{_web.sitename}}</title>
    <meta name="keywords" content="{{_web.keywords}}">
    <meta name="description" content="{{_web.description}}">
    {{ super() }}
{% endblock %}

{% block content %}
    <div class="article" id="topicList">
       <div class="topnews">
         <div class="header">
                 <a href="/topic/all" class="topic-tab  {% if tab=='all' %}current-tab{%elif tab==''%}'current-tab'{%else%}{%endif%}">全部</a>
                 <!-- <a href="/topic/good" class="topic-tab current-tab">精华</a> -->
                 {% for item in tablist %}
                    <a href="/topic/{{item.name}}" class="topic-tab {% if tab==item.name %}current-tab{%else%}{%endif%}">
                      {% if item.name=='liblog' %}liblog专区{%else%}{{item.comment}}{%endif%}
                    </a>
                 {%endfor%}
         </div>
         {% for item in itemList %}
             <div class="cell">
                <a class="user_avatar pull-left" href="/personal/@{{item.author}}">
                  <img src="{{_web.url}}{{theme_url}}/{{'common/images/pic/man.jpg' if item.pic=='' else item.pic}}" title="{{item.author}}">
                </a>
                <span class="reply_count pull-left">
                  <span class="count_of_replies" title="回复数">
                    {{item.replycount}}
                  </span>
                  <span class="count_seperator">/</span>
                  <span class="count_of_visits" title="点击数">
                    {{item.view}}
                  </span>
                </span>
                <span class="last_time pull-right">
                  <a href="/personal/@{{item.updateauthor}}">
                    <img class="user_small_avatar" src="{{_web.url}}{{theme_url}}/{{'common/images/pic/man.jpg' if item.updatepic=='' else item.updatepic}}" title="{{item.updateauthor}}">
                  </a>
                  <span class="last_active_time">
                    <time class="timeago" datetime="{{think.datetime(item.updatetime)}}"></time>
                  </span>
                </span>
                <div class="topic_title_wrapper">
                        <span class="topiclist-tab">{{item.comment}}</span>
                        <a class="topic_title" href="/topic/item/{{item.tid}}.html" title="{{item.title}}">
                          {{item.title}}
                        </a>
                </div>
              </div>
          {%endfor%}
       </div>
       {% if pageData.count>20 %}
          {% include "../common/inc/pagination.html"%}
       {%endif%}
       <div class="" style="clear:both;"></div>
    </div>
{% endblock %}
{% block footer_other %}
    <script type="text/javascript">
        $(".topic-tab").on('click',function(){
          $(".topic-tab").removeClass("current-tab");
          $(this).addClass("current-tab");
        })
    </script>
{% endblock %}
